
yu=int(input())
shu=int(input())
if (yu < 60 and shu >= 60) or(yu >=  60 and shu < 60) :
    print("1")
else:
    print("0")